/**
 * @flie 页面动画效果
 */
// tab 栏点击
var tabItems = document.querySelectorAll('.tab-item');
tabItems.forEach(tabItem => {
  tabItem.addEventListener('click', () => {
    tabItems.forEach(item => {
      item.classList.remove('active');
    });
    tabItem.classList.add('active');
  });
});

// 轮播图动画
function animate(obj, target, callback) {
  clearInterval(obj.timer);
  obj.timer = setInterval(function () {
    obj.style.transform = `translate(${target}px)`;
    callback && callback();
  }, 15);
}
